package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class SilpleNoteDemo01 {
    public static void main(String[] args) throws IOException, FileNotFoundException {
        Scanner scanner = new Scanner(System.in);
        PrintWriter printWriter = new PrintWriter(new FileOutputStream("d:/a.txt",true),true);
        while (true){
            System.out.println("请输入内容：");
            String line = scanner.nextLine();
            if("exit".equals(line)){

                break;
            }
            printWriter.println(line);
            System.out.println("结束");

        }
        PrintWriter pw = new PrintWriter(new FileOutputStream("d:/a.txt"),true);

        printWriter.close();
        scanner.close();
    }
}
